<script>
// super hacky ajax
function getLog(){
  //get the list of tasks and rewrite the task
  $.getJSON(window.location.href + "/log", function(data) {
    log_data = data["data"];
    document.getElementById("log").empty
    document.getElementById("log").innerHTML = "<span class='like-pre-dark'>" + htmlEncode(log_data) + "</span></br>";
  });
}

window.setInterval(function(){
  getLog();  //calling every 6 seconds
}, 6000);

//call right away
getLog();

function htmlEncode(s)
{
  var el = document.createElement("div");
  el.innerText = el.textContent = s;
  s = el.innerHTML;
  return s;
}
</script>

<div id="log" style="overflow-y: scroll; height:600px; width:100%;">
<p>[Gathering log...]</p>
</div>
